package xcraft.xserver;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import xcraft.xserver.persistence.Planet;
import xcraft.xserver.persistence.PlanetDAO;

@Component
public class PlanetService {
	
	private static final Logger log = LoggerFactory.getLogger(PlanetService.class);
	
    @Resource
    private PlanetDAO planetDAO;
    
    
    public Planet createPlanet(String id) {
    	Planet planet = new Planet(id);
    	
    	planetDAO.createPlanet(planet);
    	log.debug("planet created: {}", planet);
    	return planet;
    }


}
